home *** CD-ROM | disk | FTP | other *** search
/ Bubka 15 / Bubka 15.iso / html / puzzle / 03.dcr / 00005_ÉhÉâÉbÉOâ¬î-.ls < prev    next >
Encoding:
Text File  |  2002-07-20  |  3.5 KB  |  103 lines

  1. property pSprite, pLocOffset, pActive, pConstrained
  2.  
  3. on getBehaviorDescription me
  4.   return "├ëh├ë├ó├ëb├ëO├ó┬¼├«\" & RETURN & RETURN & "├ëX├ëv├ë├ó├ëC├ëg├ç├â├ëh├ë├ó├ëb├ëO├ó┬¼├«\├ç┬╗├ëv├ë├º├ëp├ëe├ëB├ç├â├¬ΓÇ║├¡├ï├çΓǪ├⌐├│├ç╞Æ├ç┬«├ç├ï├àA├ëX├ëv├ë├ó├ëC├ëg├ç┬¥├ë}├ëE├ëX├ë{├ë^├ë├¼├ç├â├ëN├ë├ñ├ëb├ëN├çΓÇÜ├ëh├ë├ó├ëb├ëO├çΓǪ ├ó├╗├¼├╢├ç┼╜├ç├╛├çΓÇ╣├ç├¥├àB├ëX├ëv├ë├ó├ëC├ëg├ç├â├á┼╛├¼├å├«├ò├á├ò├ç├ò├àA├ëX├ëe├à[├ëW├│├â├á├è├çΓǪ├Ñ┬┐├ç├ü├ç├ì├ç╞Æ├ç┬ó├ç├ê├¿├ì├º├í├çΓäó├çΓÇá├ç├ï├çΓÇ╣├ç├¥├àB" & RETURN & RETURN & "├│L├ÑΓÇô├ë├à├ë├¼├ëo├à[├ë^├ëC├ëv:" & RETURN & "├ëO├ë├ó├ët├ëB├ëb├ëN├ë├à├ë├¼├ëo├à[" & RETURN & RETURN & "├ëf├ëW├ë^├ë├ú├ër├ëf├ëI├çΓÇÜ├àA├ç┬¬├ç├â├½┬║├ç├â[├ëX├ëe├à[├ëW├º┬╝├½O├▒┬á├çΓǪ├¡u├ç┬ì]├çΓäó├ëI├ëv├ëVS├ë├í├ë├¼├ç├â├ëX├ëv├ë├ó├ëC├ëg├ç┬╝├ç├ò├àA[├ëX├ëe├à[├ëW├º┬╝├½O├▒┬á├çΓǪ├¡u├ç┬ì]├ç┬¥├⌐g├│p├»s├«\├çΓǪ├ç┬╡├ç╞Æ├ç┬«├ç┬ì├ç├É├àA├│┬½├ç┬ó├Ñ├ú├ó┬á├çΓäó├¼├ª├ç├ü├ç├ì├çΓÇ╣├ç├¥├àB" & RETURN & RETURN & "├ëp├ë├ó├ë├à├à[├ë^:" & RETURN & "- ├ëX├ëe├à[├ëW├çΓǪ├Ñ┬╝├¡├ï"
  5. end
  6.  
  7. on getBehaviorTooltip me
  8.   return "├ëX├ëv├ë├ó├ëC├ëg├ç┬¥├ëh├ë├ó├ëb├ëO├ç┬╝├ç┬┤├ç├ê├ç├è├ç┬º├çΓǪ├ç┬╡├çΓÇ╣├ç├¥├àB├ë}├ëE├ëX├ë{├ë^├ë├¼├ç┬¥├ó├╝├ç┬╡├ç╞Æ├ç┬ó├ç├ê├ñΓÇÿ├àA├ëX├ëv├ë├ó├ëC├ëg├ç├ò ├ëJ├à[├ë\├ë├ú├çΓǪ├ó├á├ç┬í├ç╞Æ├á┼╛├¼├å├ç┬╡├çΓÇ╣├ç├¥├àB"
  9. end
  10.  
  11. on beginSprite me
  12.   pSprite = sprite(me.spriteNum)
  13.   vMember = pSprite.member
  14.   case vMember.type of
  15.     #animGif, #flash, #quickTimeMedia, #digitalVideo, #vectorShape:
  16.       if vMember.directToStage then
  17.         alert("Sprite" && pSprite.spriteNum & ": Direct To Stage media may cause" && "playback problems with the 'Moveable Sprite' behavior.")
  18.       end if
  19.   end case
  20.   pActive = 0
  21. end
  22.  
  23. on mouseUp me
  24.   global withlist
  25.   if sprite(the currentSpriteNum).within(the currentSpriteNum - 40) then
  26.     mDrag(0)
  27.     if getAt(withlist, the currentSpriteNum - 50) = 0 then
  28.       puppetSound(1, 44)
  29.       set the loc of sprite the currentSpriteNum to the loc of sprite (the currentSpriteNum - 40)
  30.       setAt(withlist, the currentSpriteNum - 50, 1)
  31.       sprite(the currentSpriteNum).locZ = the currentSpriteNum - 200
  32.     end if
  33.   end if
  34.   mDrag(0)
  35. end
  36.  
  37. on mouseDown me
  38.   global plocz, withlist
  39.   if sprite(the currentSpriteNum).within(the currentSpriteNum - 40) then
  40.     mDrag(0)
  41.   else
  42.     mDrag(1)
  43.   end if
  44.   if getAt(withlist, the currentSpriteNum - 50) = 0 then
  45.     plocz = plocz + 1
  46.     sprite(the currentSpriteNum).locZ = plocz
  47.   end if
  48. end
  49.  
  50. on prepareFrame me
  51.   if the mouseUp then
  52.     mDrag(0)
  53.   end if
  54.   if pActive then
  55.     mDragSprite(me)
  56.   end if
  57. end
  58.  
  59. on mDrag vActive
  60.   pActive = vActive
  61.   pLocOffset = pSprite.loc - the mouseLoc
  62.   sendAllSprites(#Active_Sprite, the currentSpriteNum * pActive)
  63. end
  64.  
  65. on mDragSprite
  66.   pSprite.loc = the mouseLoc + pLocOffset
  67.   if pConstrained then
  68.     vLeftDiff = pSprite.rect.left
  69.     if vLeftDiff < 0 then
  70.       pSprite.locH = pSprite.locH - vLeftDiff
  71.     end if
  72.     vRightDiff = pSprite.rect.right - (the stage).rect.width
  73.     if vRightDiff > 0 then
  74.       pSprite.locH = pSprite.locH - vRightDiff
  75.     end if
  76.     vTopDiff = pSprite.rect.top
  77.     if vTopDiff < 0 then
  78.       pSprite.locV = pSprite.locV - vTopDiff
  79.     end if
  80.     vBottomDiff = pSprite.rect.bottom - (the stage).rect.height
  81.     if vBottomDiff > 0 then
  82.       pSprite.locV = pSprite.locV - vBottomDiff
  83.     end if
  84.   end if
  85. end
  86.  
  87. on Forwarded_mouseDown me
  88.   if not pActive then
  89.     mDrag(1)
  90.   end if
  91.   return the currentSpriteNum
  92. end
  93.  
  94. on isOKToAttach me, aSpriteType, aSpriteNum
  95.   return aSpriteType = #graphic
  96. end
  97.  
  98. on getPropertyDescriptionList
  99.   vPDList = [:]
  100.   setaProp(vPDList, #pConstrained, [#comment: "├ëX├ëe├à[├ëW├çΓǪ├Ñ┬╝├¡├ï", #format: #boolean, #default: 1])
  101.   return vPDList
  102. end
  103.